package io.terminus.lego.shinda.web.controller.dto

import io.terminus.lego.shinda.service.annotation.NoArg
import org.springframework.beans.BeanUtils
import java.io.Serializable
import java.util.*

/**
 * @author wangmeng
 * @date 2018/4/26
 */
@NoArg
data class UserDTO(
        val id: Long? = null,
        val phone: String? = null,
        val email: String? = null,
        val avatarUrl: String? = null,
        val username: String? = null,
        val realName: String? = null,
        val nickName: String? = null,
        val enabled: Boolean = true,
        val birthday: Date? = null,
        val createdAt: Date? = null,
        val updatedAt: Date? = null
) : Serializable



fun UserDTO.copy(): UserDTO {
    val newTarget = UserDTO()
    BeanUtils.copyProperties(this, newTarget)
    return newTarget
}